/*
 * User: user
 * Date: 10/12/2007
 * Time: 12:45:39
 */
package javax.webbeans;

import java.lang.annotation.Annotation;
import java.util.Set;

public interface Manager {

    /**
     Obtains the current instance of a component.

     @param type         The API type of the requested component.
     @param bindingTypes The specified binding types annotations for the requested component.
     @return The resolved component.
     */
    <T> T getInstanceByType(Class<T> type, Annotation... bindingTypes);

    /**
     Obtains the current instance of a component.

     @param type         The API type of the requested component.
     @param bindingTypes The specified binding types annotations for the requested component.
     @return The resolved component.
     */
    <T> T getInstanceByType(TypeLiteral<T> type, Annotation... bindingTypes);

    <T> Set<Bean<T>> resolveByType(Class<T> apiType, Annotation... bindingTypes);

    <T> Set<Bean<T>> resolveByType(TypeLiteral<T> apiType, Annotation... bindingTypes);

    Object getInstanceByName(String name);

    <T> Set<Bean<T>> resolveByName(String name);
}